{% load static %}

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

        <title>用户登录</title>
        <link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap.css' %}" />
        <link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap-theme.css' %}" />
        <link rel="stylesheet" href="{% static 'common/css/default.css' %}" />
        <script src="{% static 'common/js/jquery.min.js' %}"></script>
        <script src="{% static 'bootstrap/js/bootstrap.js' %}"></script>
        <script type="text/javascript">
            $(document).ready(function(){

                function strToJson(str) {
                    var json = eval('(' + str + ')');
                    return json;

                }

                var errors = $('#errors').text();
                errors = strToJson(errors);

                var showNode = $('#show-errors');
                for (var error in errors) {
                    error = errors[error];
                    for (var value in error) {
                        showNode.append('<p>' + error[value]['message'] + '</p>');
                        console.log(error[value]['message']);
                    }
                }
            });
        </script>
    </head>
    <body>

        <div id="errors" style="display: none;">
            {{ errors }}
        </div>

        <div id="show-errors">

        </div>

    </body>
</html>